package demo
{
	import Box2D.Collision.Shapes.b2CircleShape;
	import Box2D.Collision.Shapes.b2PolygonShape;
	import Box2D.Dynamics.b2Body;
	import Box2D.Dynamics.b2BodyDef;
	import Box2D.Dynamics.b2FixtureDef;
	
	import flash.display.Sprite;
	
	public class DemoScene1CreateBody extends Scene
	{
		protected var body:b2Body;
		protected var ball:b2Body;
		public function DemoScene1CreateBody(s:Sprite)
		{
			super(s);
			//创建刚体的数据模型及位置
			var my_body:b2BodyDef = new b2BodyDef();
			my_body.position.Set(400 * m_physScale, 500 * m_physScale);
			my_body.angle = 15 * Math.PI / 180 ;
			my_body.type = b2Body.b2_dynamicBody;
			//创建刚体的形状
			var my_box:b2PolygonShape = new b2PolygonShape();
			my_box.SetAsBox(50 / 2 * m_physScale, 50 / 2 * m_physScale);
			//创建刚体的物理参数
			var my_fixture:b2FixtureDef = new b2FixtureDef();
			my_fixture.density = 1;
			my_fixture.friction = 1;
			my_fixture.restitution = 0.5;
			my_fixture.shape = my_box;
			my_fixture.isSensor = false;
			//在物理世界初始化这个刚体并得到它的刚体对象
//			body = m_world.CreateBody(my_body);
//			body.CreateFixture(my_fixture);
		}
	}
}